const routes = [
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/login',
    component: './login',
    headerRender: false,
  },
  {
    path: '/home',
    component: './home',
    title: 'topBar.home',
  },
  {
    path: '/news',
    component: './news',
    title: 'topBar.news',
  },
  {
    path: '/question',
    component: './question',
    title: 'topBar.question',
  },
  {
    path: 'searchInput',
    title: 'topBar.search',
  },
  {
    path: '/search',
    component: './search',
  },
  {
    path: '/article',
    component: './article',
  },
  {
    // name: 'dashboard',
    path: '/dashboard',
    // title: 'topBar.dashboard',
    routes: [
      {
        path: '',
        redirect: '/dashboard/person-management',
      },
      {
        path: 'person-management',
        component: './dashboard/person-management',
        title: 'dashboard.personCenter',
      },
      {
        path: 'write',
        title: 'dashboard.write',
        component: './dashboard/write',
      },
      {
        path: 'edit',
        component: './dashboard/write',
      },
      {
        path: 'my-articles',
        component: './dashboard/my-articles',
        title: 'dashboard.myArticles',
      },
      {
        path: 'collection',
        title: 'dashboard.collection',
        component: './dashboard/collection',
      },
      {
        path: 'attention',
        title: 'dashboard.attention',
        component: './dashboard/attention',
      },
      // {
      //   // name: '权限演示',
      //   path: 'access',
      //   component: './access',
      // },
      // {
      //   // name: ' CRUD 示例',
      //   path: 'table',
      //   component: './table',
      // },
    ],
  },
  {
    path: '*',
    component: './404',
  },
];

export default routes;
